#include "syscall.h"
#include "shell.h"

void myshell()
{
    SpaceId newProc;
    OpenFileId input = ConsoleInput;
    OpenFileId output = ConsoleOutput;
    char prompt[2], ch, buffer[60];
    int i;

    prompt[0] = '-';
    prompt[1] = '-';

	//Print("\nWelcome to my shell!\n");

    while( 1 )
    {
		Print("seedclass@nachos$ ");
		//Write(prompt, 2, output);

		i = 0;
	
		do {
			Read(&buffer[i], 1, input); 
			//Write(&buffer[i], 1, output);
		} while( buffer[i++] != '\0' );

		buffer[--i] = '\0';
//Print("after buffer!\n");
		if( i > 0 ) {
Print("before exec!\n");
			newProc = Exec(buffer);
			//Join(newProc);
		}
    }
}
